//
//  PhoneInfoModel.swift
//  E-CycleForShop
//
//  Created by enghou on 17/3/7.
//  Copyright © 2017年 xyxorigation. All rights reserved.
//

import UIKit

class PhoneInfoModel: BaseModel {
    override init(source sourceDt: Dictionary<String, Any>?) {
        super.init(source: sourceDt)
        guard self.data != nil else{
            return
        }
        var dataDi = self.data! as? Dictionary<String,Any>
        guard dataDi != nil else {
            return
        }//key	String	"productDetection"
        
        if let num = dataDi!["num"] as? String {
            number = StringToInt.toInt(source: num)
        }
        
        if let dataDic = dataDi!["productDetection"] as? Dictionary<String,Any> {
            if let ids = dataDic["id"] as? Int {
                id = ids
            }
            if let base_ids = dataDic["base_id"] as? Int {
                base_id = base_ids
            }
            if let rear_camer = dataDic["rear_camera"] as? Int {
                rear_camera = rear_camer
            }
            if let front_cam = dataDic["front_camera"] as? Int {
                front_camera = front_cam
            }
            if let speaker = dataDic["loudspeaker"] as? Int {
                loudspeaker = speaker
            }
            if let phone_func = dataDic["phone_function"] as? Int {
                phone_function = phone_func
            }
            if let tel_receiver = dataDic["telephone_receiver"] as? Int {
                telephone_receiver = tel_receiver
            }
            if let micro = dataDic["microphone"] as? Int {
                microphone = micro
            }
            if let blueToo = dataDic["bluetooth"] as? Int{
                bluetooth = blueToo
            }
            if let wi = dataDic["wifi"] as? Int{
                wifi = wi
            }
            if let gp = dataDic["gps"] as? Int{
                gps = gp
            }
            if let compas = dataDic["compass"] as? Int{
                compass = compas
            }
            if let gyro = dataDic["gyroscope"] as? Int{
                gyroscope = gyro
            }
            if let flash = dataDic["flashlight"] as? Int{
                flashlight = flash
            }
            if let fingprint = dataDic["fingerprint"] as? Int{
                fingerprint = fingprint
            }
            if let iclu = dataDic["icloud"] as? Int{
                icloud = iclu
            }
            if let stat = dataDic["state"] as? Int{
                state = stat
            }
            if let siz = dataDic["size"] as? String {
                size = siz
            }
            if let sys_os = dataDic["system_os"] as? String {
                system_os = sys_os
            }
            if let cp = dataDic["cpu"] as? String {
                cpu = cp
            }
            if let internal_st = dataDic["internal_storage"] as? String {
                internal_storage = internal_st
            }
            if let resoluti = dataDic["resolution_ratio"] as? String {
                resolution_ratio = resoluti
            }
            if let touc = dataDic["touch"] as? Int {
                touch = touc
            }
            if let fingerpri = dataDic["fingerprint_recognition"] as? Int{
                fingerprint_recognition = fingerpri
            }
            if let sensor = dataDic["l_sensor"] as? Int {
                l_sensor = sensor
            }
            if let range = dataDic["range_sensor"] as? Int{
                range_sensor = range
            }
            if let serial = dataDic["serial_number"] as? String {
                serial_number = serial
            }
            
            if let trad = dataDic["trademark"] as? String {
                trademark = trad
            }
            if let phoneMod = dataDic["phone_model"] as? String {
                phone_model = phoneMod
            }
            if let typid = dataDic["typeid"] as? String {
                typeid = typid
            }
            if let scren_show = dataDic["screen_show"] as? Int {
                screen_show = scren_show
            }
            if let scren_touch = dataDic["screen_touch"] as? Int {
                screen_touch = scren_touch
            }
        }
    }
    
    var id : Int = -1
    var base_id : Int = -1
    var rear_camera : Int = -1
    var front_camera : Int = -1
    var loudspeaker : Int = -1
    var phone_function : Int = -1
    var telephone_receiver : Int = -1
    var microphone : Int = -1
    var bluetooth : Int = -1
    var wifi : Int = -1
    var gps : Int = -1
    var compass : Int = -1
    var gyroscope : Int = -1
    var flashlight : Int = -1
    var fingerprint : Int = -1
    var icloud : Int = -1
    var state : Int = -1
    var size : String = ""
    var system_os : String = ""
    var cpu : String = ""
    var internal_storage : String = ""
    var resolution_ratio : String = ""
    var touch : Int = -1
    var fingerprint_recognition : Int = -1
    var l_sensor : Int = -1
    var range_sensor : Int = -1
    var serial_number : String = ""
    var trademark : String = ""
    var phone_model : String = ""
    var typeid = ""
    var screen_show : Int = -1
    var screen_touch : Int = -1
    var number : Int = -1
}
